<div class="layui-form" lay-filter="LAY-demo-testDemo-form" style="padding: 20px 30px 0 0;">

    <script type="text/html" template>
        {{# if(d.params.id != null) { }}
        <div class="layui-form-item">
            <label class="layui-form-label">ID</label>
            <div class="layui-input-inline">
                <input type="text" name="id" readonly value="{{ d.params.id || '' }}" class="layui-input">
            </div>
        </div>
        {{# } }}
    </script>

    <script type="text/html" template>
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-inline">
                <input type="text" name="name" value="{{ d.params.name || '' }}" lay-verify="required"
                    placeholder="请输入用户名" autocomplete="off" class="layui-input">
            </div>
        </div>
    </script>

    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="button" lay-submit lay-filter="LAY-demo-testDemo-form-submit" value="确认" class="layui-btn">
        </div>
    </div>

</div>